package com.aishua.fire.jpa;

import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.aishua.fire.jpa.entity.AccountAccountteam;
import com.aishua.fire.jpa.entity.AccountAccountteamId;

public interface AccountAccountteamDao extends JpaRepository<AccountAccountteam, AccountAccountteamId>,JpaSpecificationExecutor<AccountAccountteam> {
	 @Transactional
	 @Modifying
	 @Query(value="delete from account_accountteam where accountteam_id=?1 and account_id=?2",nativeQuery=true)
	 void deleteByAccountteamIdAndAccountId(Long accoutteamId,Long accountId);
	 
	 @Transactional
	 @Modifying
	 @Query(value="DELETE FROM account_accountteam WHERE account_id=?1",nativeQuery=true)
	 void deleteByAccountId(Long accountId);
}
